<?php
namespace Home\Controller;

/**
 * 活动页面 控制器
 * @author liubo <liubo@ilongyuan.com.cn>
 */
class EventsController extends HomeController
{
    private $eventObj;
    public function _initialize() {
        parent::_initialize();
        $this->eventObj = event('Events');
        C('DEFAULT_THEME', 'ui3');
    }

    public function web($id = 0) {
        if (empty($id) || !is_numeric($id)) {
            $this->error('参数有误');
        }
        $events = $this->eventObj->detail(intval($id));
        if (empty($events)) {
            $this->error('参数有误');
        }
        $this->events = $events;
        $this->title = $events['title'];
        $this->display();
    }
}